.class public Lcom/estrongs/android/pop/app/InstallMonitorReceiver;
.super Landroid/content/BroadcastReceiver;
.source "InstallMonitorReceiver.java"


# instance fields
.field private a:Ljava/util/HashSet;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/HashSet<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field

.field private b:[Ljava/lang/String;


# direct methods
.method public constructor <init>()V
    .locals 3

    .line 1
    invoke-direct {p0}, Landroid/content/BroadcastReceiver;-><init>()V

    const/4 v0, 0x0

    .line 2
    iput-object v0, p0, Lcom/estrongs/android/pop/app/InstallMonitorReceiver;->a:Ljava/util/HashSet;

    const/16 v0, 0x1c

    new-array v0, v0, [Ljava/lang/String;

    const/4 v1, 0x0

    const-string v2, "com.supercell.clashofclans"

    aput-object v2, v0, v1

    const/4 v1, 0x1

    const-string v2, "com.umonistudio.tile"

    aput-object v2, v0, v1

    const/4 v1, 0x2

    const-string v2, "com.mobilityware.solitaire"

    aput-object v2, v0, v1

    const/4 v1, 0x3

    const-string v2, "com.supercell.hayday"

    aput-object v2, v0, v1

    const/4 v1, 0x4

    const-string v2, "com.selfawaregames.acecasino"

    aput-object v2, v0, v1

    const/4 v1, 0x5

    const-string v2, "air.com.bitrhymes.bingo"

    aput-object v2, v0, v1

    const/4 v1, 0x6

    const-string v2, "net.froemling.bombsquad"

    aput-object v2, v0, v1

    const/4 v1, 0x7

    const-string v2, "com.midasplayer.apps.bubblewitchsaga2"

    aput-object v2, v0, v1

    const/16 v1, 0x8

    const-string v2, "com.king.candycrushsaga"

    aput-object v2, v0, v1

    const/16 v1, 0x9

    const-string v2, "com.igg.castleclash"

    aput-object v2, v0, v1

    const/16 v1, 0xa

    const-string v2, "com.leftover.CoinDozer"

    aput-object v2, v0, v1

    const/16 v1, 0xb

    const-string v2, "com.gotv.crackle.handset"

    aput-object v2, v0, v1

    const/16 v1, 0xc

    const-string v2, "com.glu.deerhunt2"

    aput-object v2, v0, v1

    const/16 v1, 0xd

    const-string v2, "com.midasplayer.apps.diamonddiggersaga"

    aput-object v2, v0, v1

    const/16 v1, 0xe

    const-string v2, "com.explorationbase.ExplorationLite"

    aput-object v2, v0, v1

    const/16 v1, 0xf

    const-string v2, "com.king.farmheroessaga"

    aput-object v2, v0, v1

    const/16 v1, 0x10

    const-string v2, "com.bigduckgames.flow"

    aput-object v2, v0, v1

    const/16 v1, 0x11

    const-string v2, "com.gamecircus.PrizeClaw"

    aput-object v2, v0, v1

    const/16 v1, 0x12

    const-string v2, "com.melimots.WordSearch"

    aput-object v2, v0, v1

    const/16 v1, 0x13

    const-string v2, "com.socialquantum.acityint"

    aput-object v2, v0, v1

    const/16 v1, 0x14

    const-string v2, "com.android.calculator2"

    aput-object v2, v0, v1

    const/16 v1, 0x15

    const-string v2, "com.google.android.calendar"

    aput-object v2, v0, v1

    const/16 v1, 0x16

    const-string v2, "com.android.contacts"

    aput-object v2, v0, v1

    const/16 v1, 0x17

    const-string v2, "com.google.android.apps.docs"

    aput-object v2, v0, v1

    const/16 v1, 0x18

    const-string v2, "com.google.android.gm"

    aput-object v2, v0, v1

    const/16 v1, 0x19

    const-string v2, "com.google.earth"

    aput-object v2, v0, v1

    const/16 v1, 0x1a

    const-string v2, "com.android.vending"

    aput-object v2, v0, v1

    const/16 v1, 0x1b

    const-string v2, "com.quickoffice.android"

    aput-object v2, v0, v1

    .line 3
    iput-object v0, p0, Lcom/estrongs/android/pop/app/InstallMonitorReceiver;->b:[Ljava/lang/String;

    return-void
.end method

.method private a(Landroid/content/Context;)Ljava/util/HashSet;
    .locals 4
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/content/Context;",
            ")",
            "Ljava/util/HashSet<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation

    .line 1
    iget-object v0, p0, Lcom/estrongs/android/pop/app/InstallMonitorReceiver;->a:Ljava/util/HashSet;

    if-nez v0, :cond_2

    .line 2
    new-instance v0, Ljava/util/HashSet;

    invoke-direct {v0}, Ljava/util/HashSet;-><init>()V

    iput-object v0, p0, Lcom/estrongs/android/pop/app/InstallMonitorReceiver;->a:Ljava/util/HashSet;

    .line 3
    invoke-virtual {p1}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v0

    .line 4
    new-instance v1, Landroid/content/Intent;

    const-string v2, "android.intent.action.MAIN"

    invoke-direct {v1, v2}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    const-string v2, "android.intent.category.HOME"

    .line 5
    invoke-virtual {v1, v2}, Landroid/content/Intent;->addCategory(Ljava/lang/String;)Landroid/content/Intent;

    const/4 v2, 0x0

    .line 6
    invoke-virtual {v0, v1, v2}, Landroid/content/pm/PackageManager;->queryIntentActivities(Landroid/content/Intent;I)Ljava/util/List;

    move-result-object v0

    .line 7
    invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v0

    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-eqz v1, :cond_0

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Landroid/content/pm/ResolveInfo;

    .line 8
    iget-object v3, p0, Lcom/estrongs/android/pop/app/InstallMonitorReceiver;->a:Ljava/util/HashSet;

    iget-object v1, v1, Landroid/content/pm/ResolveInfo;->activityInfo:Landroid/content/pm/ActivityInfo;

    iget-object v1, v1, Landroid/content/pm/ActivityInfo;->packageName:Ljava/lang/String;

    invoke-virtual {v3, v1}, Ljava/util/HashSet;->add(Ljava/lang/Object;)Z

    goto :goto_0

    .line 9
    :cond_0
    :goto_1
    iget-object v0, p0, Lcom/estrongs/android/pop/app/InstallMonitorReceiver;->b:[Ljava/lang/String;

    array-length v1, v0

    if-ge v2, v1, :cond_1

    .line 10
    iget-object v1, p0, Lcom/estrongs/android/pop/app/InstallMonitorReceiver;->a:Ljava/util/HashSet;

    aget-object v0, v0, v2

    invoke-virtual {v1, v0}, Ljava/util/HashSet;->add(Ljava/lang/Object;)Z

    add-int/lit8 v2, v2, 0x1

    goto :goto_1

    .line 11
    :cond_1
    iget-object v0, p0, Lcom/estrongs/android/pop/app/InstallMonitorReceiver;->a:Ljava/util/HashSet;

    invoke-virtual {p1}, Landroid/content/Context;->getPackageName()Ljava/lang/String;

    move-result-object p1

    invoke-virtual {v0, p1}, Ljava/util/HashSet;->add(Ljava/lang/Object;)Z

    .line 12
    :cond_2
    iget-object p1, p0, Lcom/estrongs/android/pop/app/InstallMonitorReceiver;->a:Ljava/util/HashSet;

    return-object p1
.end method

.method private a(Landroid/content/Context;Ljava/lang/String;)V
    .locals 1

    .line 13
    invoke-static {}, Lcom/estrongs/android/pop/app/analysis/e;->d()Lcom/estrongs/android/pop/app/analysis/e;

    move-result-object v0

    invoke-virtual {v0, p1, p2}, Lcom/estrongs/android/pop/app/analysis/e;->c(Landroid/content/Context;Ljava/lang/String;)V

    return-void
.end method

.method private b(Landroid/content/Context;)Z
    .locals 5

    const/4 v0, 0x0

    :try_start_0
    const-string v1, "activity"

    .line 1
    invoke-virtual {p1, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Landroid/app/ActivityManager;

    const/4 v2, 0x2

    .line 2
    invoke-virtual {v1, v2}, Landroid/app/ActivityManager;->getRunningTasks(I)Ljava/util/List;

    move-result-object v1

    if-eqz v1, :cond_5

    .line 3
    invoke-interface {v1}, Ljava/util/List;->size()I

    move-result v2

    if-nez v2, :cond_0

    goto/16 :goto_1

    .line 4
    :cond_0
    invoke-interface {v1, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/app/ActivityManager$RunningTaskInfo;

    iget-object v2, v2, Landroid/app/ActivityManager$RunningTaskInfo;->topActivity:Landroid/content/ComponentName;

    invoke-virtual {v2}, Landroid/content/ComponentName;->getPackageName()Ljava/lang/String;

    move-result-object v2

    .line 5
    invoke-interface {v1, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Landroid/app/ActivityManager$RunningTaskInfo;

    iget v3, v3, Landroid/app/ActivityManager$RunningTaskInfo;->numActivities:I

    const/4 v4, 0x1

    if-nez v3, :cond_1

    invoke-interface {v1}, Ljava/util/List;->size()I

    move-result v3

    if-le v3, v4, :cond_1

    .line 6
    invoke-interface {v1, v4}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Landroid/app/ActivityManager$RunningTaskInfo;

    iget-object v1, v1, Landroid/app/ActivityManager$RunningTaskInfo;->topActivity:Landroid/content/ComponentName;

    invoke-virtual {v1}, Landroid/content/ComponentName;->getPackageName()Ljava/lang/String;

    move-result-object v2

    .line 7
    :cond_1
    invoke-static {}, Lcom/estrongs/android/pop/utils/q;->b()Z

    move-result v1

    if-eqz v1, :cond_4

    const-string p1, "video"

    .line 8
    invoke-virtual {v2, p1}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result p1

    if-nez p1, :cond_3

    const-string p1, "camera"

    invoke-virtual {v2, p1}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result p1

    if-nez p1, :cond_3

    const-string p1, "gallery"

    invoke-virtual {v2, p1}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result p1

    if-nez p1, :cond_3

    const-string p1, "youtube"

    .line 9
    invoke-virtual {v2, p1}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result p1

    if-nez p1, :cond_3

    const-string p1, "com.lenovo.scg"

    invoke-virtual {v2, p1}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result p1

    if-nez p1, :cond_3

    const-string p1, "qqlive"

    invoke-virtual {v2, p1}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result p1

    if-nez p1, :cond_3

    const-string p1, "youku"

    .line 10
    invoke-virtual {v2, p1}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result p1

    if-nez p1, :cond_3

    const-string p1, "letv"

    invoke-virtual {v2, p1}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result p1

    if-nez p1, :cond_3

    const-string p1, "com.storm."

    invoke-virtual {v2, p1}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result p1

    if-nez p1, :cond_3

    const-string p1, "com.tudou."

    .line 11
    invoke-virtual {v2, p1}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result p1

    if-nez p1, :cond_3

    const-string p1, "pplive"

    invoke-virtual {v2, p1}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result p1

    if-eqz p1, :cond_2

    goto :goto_0

    :cond_2
    return v0

    :cond_3
    :goto_0
    return v4

    .line 12
    :cond_4
    invoke-direct {p0, p1}, Lcom/estrongs/android/pop/app/InstallMonitorReceiver;->a(Landroid/content/Context;)Ljava/util/HashSet;

    move-result-object p1

    invoke-virtual {p1, v2}, Ljava/util/HashSet;->contains(Ljava/lang/Object;)Z

    move-result p1
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    xor-int/2addr p1, v4

    return p1

    :catch_0
    :cond_5
    :goto_1
    return v0
.end method


# virtual methods
.method public onReceive(Landroid/content/Context;Landroid/content/Intent;)V
    .locals 7

    .line 1
    invoke-static {p1}, Lcom/permission/runtime/f;->b(Landroid/content/Context;)Z

    move-result v0

    if-nez v0, :cond_0

    return-void

    .line 2
    :cond_0
    :try_start_0
    invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;

    move-result-object v0

    const-string v1, "android.intent.action.PACKAGE_ADDED"

    .line 3
    invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    const/4 v2, 0x0

    const-string v3, "android.intent.extra.REPLACING"

    const/4 v4, 0x1

    const-string v5, ":"

    if-eqz v1, :cond_4

    .line 4
    :try_start_1
    invoke-virtual {p2}, Landroid/content/Intent;->getDataString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v1, v5}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;

    move-result-object v1

    aget-object v1, v1, v4

    .line 5
    invoke-virtual {p2, v3, v2}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z

    move-result v6

    if-nez v6, :cond_1

    .line 6
    invoke-direct {p0, p1, v1}, Lcom/estrongs/android/pop/app/InstallMonitorReceiver;->a(Landroid/content/Context;Ljava/lang/String;)V

    .line 7
    :cond_1
    invoke-static {}, Lcom/estrongs/android/pop/app/unlock/h;->d()Lcom/estrongs/android/pop/app/unlock/h;

    move-result-object v6

    invoke-virtual {v6, v1}, Lcom/estrongs/android/pop/app/unlock/h;->a(Ljava/lang/String;)V

    .line 8
    invoke-direct {p0, p1}, Lcom/estrongs/android/pop/app/InstallMonitorReceiver;->b(Landroid/content/Context;)Z

    move-result v6

    if-eqz v6, :cond_2

    return-void

    .line 9
    :cond_2
    sget-boolean v6, Lcom/estrongs/android/pop/j;->k0:Z

    if-nez v6, :cond_3

    .line 10
    invoke-static {p1, v1}, Lcom/estrongs/android/pop/app/d0;->c(Landroid/content/Context;Ljava/lang/String;)V

    .line 11
    :cond_3
    sget-boolean v6, Lcom/estrongs/android/pop/j;->m0:Z

    if-nez v6, :cond_4

    .line 12
    invoke-static {}, Les/mg;->f()Les/mg;

    move-result-object v6

    invoke-virtual {v6, v1}, Les/mg;->f(Ljava/lang/String;)V

    .line 13
    :cond_4
    invoke-direct {p0, p1}, Lcom/estrongs/android/pop/app/InstallMonitorReceiver;->b(Landroid/content/Context;)Z

    move-result v1

    if-eqz v1, :cond_5

    return-void

    :cond_5
    const-string v1, "android.intent.action.PACKAGE_REMOVED"

    .line 14
    invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_8

    .line 15
    invoke-virtual {p2, v3, v2}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z

    move-result v0

    if-eqz v0, :cond_6

    return-void

    .line 16
    :cond_6
    invoke-virtual {p2}, Landroid/content/Intent;->getDataString()Ljava/lang/String;

    move-result-object p2

    if-nez p2, :cond_7

    return-void

    .line 17
    :cond_7
    invoke-virtual {p2, v5}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;

    move-result-object p2

    aget-object p2, p2, v4

    .line 18
    invoke-static {}, Lcom/estrongs/android/pop/app/analysis/e;->d()Lcom/estrongs/android/pop/app/analysis/e;

    move-result-object v0

    invoke-virtual {v0, p1, p2}, Lcom/estrongs/android/pop/app/analysis/e;->a(Landroid/content/Context;Ljava/lang/String;)V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_0

    :catch_0
    move-exception p1

    .line 19
    invoke-virtual {p1}, Ljava/lang/Exception;->printStackTrace()V

    :cond_8
    :goto_0
    return-void
.end method
